﻿
public class Singleton<T> where T: new()
{
    private static T _instance;

    private static object _lock = new object();

    public static T Ins
    {
        get
        {
            lock (_lock)
            {
                if (_instance == null)
                {
                    _instance = new T();
                }

                return _instance;
            }
        }
    }
}
